/*
 * Copyright (c) 2016-2017 fulihui.com All right reserved
 * Project: information-core-170307
 * File name: DynamicNavbarRepository.java
 */

package com.fulihui.information.core.repository;

import com.fulihui.information.dal.dataobj.InfoDynamicNavbarExample;
import com.fulihui.information.dal.dataobj.InfoDynamicNavbarKey;
import com.fulihui.information.dto.DynamicNavbarDTO;
import com.fulihui.information.request.DynamicNavbarQueryPageRequest;
import com.fulihui.information.request.DynamicNavbarSaveRequest;

import java.util.List;

/**
 * @author Willard.Hu on 2017/3/3 0003.
 */
public interface DynamicNavbarRepository {

    /**
     * 插入新数据
     * @param request {@link DynamicNavbarSaveRequest}
     */
    void insert(DynamicNavbarSaveRequest request);

    /**
     * 更新
     * @param request {@link DynamicNavbarSaveRequest}
     * @return 更新结果
     */
    boolean update(DynamicNavbarSaveRequest request);

    /**
     * 删除
     * @param key {@link InfoDynamicNavbarKey}
     * @return 删除结果
     */
    boolean delete(InfoDynamicNavbarKey key);

    /**
     * 查询
     * @param key {@link InfoDynamicNavbarKey}
     * @return 查询结果 {@link DynamicNavbarDTO}
     */
    DynamicNavbarDTO querySingle(InfoDynamicNavbarKey key);

    /**
     * 分页查询
     * @param request {@link DynamicNavbarQueryPageRequest}
     */
    List<DynamicNavbarDTO> queryPage(DynamicNavbarQueryPageRequest request);

    /**
     * 查询指定版本的上一个版本
     * @param osType 系统类型 Android / ios
     * @param version 版本
     * @return {@link DynamicNavbarDTO}
     */
    DynamicNavbarDTO queryPreviousVersion(String osType, int version);

    /**
     * 按条件查询
     * @param example {@link InfoDynamicNavbarExample}
     * @return {@link DynamicNavbarDTO} 列表
     */
    List<DynamicNavbarDTO> query(InfoDynamicNavbarExample example);

    /**
     * 按条件统计数量
     * @param request {@link DynamicNavbarQueryPageRequest}
     * @return 统计数
     */
    int totalCount(DynamicNavbarQueryPageRequest request);
}
